package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import controller.viewController.ProductController;

public class AddProduct {

	private JFrame frame;
	private JTextField textFieldComments;

	public ProductController pc;
	
	public JComboBox comboBoxProduct;
	public JComboBox comboBoxTrainer;
	public JComboBox comboBoxPlace;

	
	/**
	 * Launch the application.
	 */
//	public static void main(String[] args) {
//		EventQueue.invokeLater(new Runnable() {
//			@Override
//			public void run() {
//				try {
//					AddProduct window = new AddProduct();
//					window.frame.setVisible(true);
//				} catch (Exception e) {
//					e.printStackTrace();
//				}
//			}
//		});
//	}

	/**
	 * Create the application.
	 */
	public AddProduct() {
		initialize();
		pc.fuellen();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setResizable(false);
		frame.setBounds(100, 100, 730, 476);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		comboBoxProduct = new JComboBox();
		comboBoxProduct.setBounds(122, 30, 293, 20);
		frame.getContentPane().add(comboBoxProduct);
		
		JLabel lblProduct = new JLabel("Produkt:");
		lblProduct.setBounds(20, 33, 92, 14);
		frame.getContentPane().add(lblProduct);
		
		comboBoxTrainer = new JComboBox();
		comboBoxTrainer.setBounds(122, 61, 293, 20);
		frame.getContentPane().add(comboBoxTrainer);
		
		JLabel lblTrainer = new JLabel("Trainer:");
		lblTrainer.setBounds(20, 64, 92, 14);
		frame.getContentPane().add(lblTrainer);
		
		comboBoxPlace = new JComboBox();
		comboBoxPlace.setBounds(122, 92, 293, 20);
		frame.getContentPane().add(comboBoxPlace);
		
		JLabel lblPlace = new JLabel("Ort:");
		lblPlace.setBounds(20, 95, 92, 14);
		frame.getContentPane().add(lblPlace);
		
		JTextArea textAreaProductDescription = new JTextArea();
		textAreaProductDescription.setBounds(465, 61, 205, 51);
		frame.getContentPane().add(textAreaProductDescription);
		
		JLabel lblProductDescription = new JLabel("Produkt Beschreibungen:");
		lblProductDescription.setBounds(465, 33, 193, 14);
		frame.getContentPane().add(lblProductDescription);
		
		textFieldComments = new JTextField();
		textFieldComments.setBounds(122, 123, 548, 20);
		frame.getContentPane().add(textFieldComments);
		textFieldComments.setColumns(10);
		
		JLabel lblComments = new JLabel("Bemerkungen:");
		lblComments.setBounds(20, 126, 92, 14);
		frame.getContentPane().add(lblComments);
		
		JButton btnAddProduct = new JButton("Produkt hinzuf\u00FCgen");
		btnAddProduct.setBounds(20, 203, 125, 23);
		frame.getContentPane().add(btnAddProduct);
		btnAddProduct.addActionListener(action_btnAddProduct);
		
		JButton btnBack = new JButton("Zur\u00FCck");
		btnBack.setBounds(170, 203, 125, 23);
		frame.getContentPane().add(btnBack);
		btnBack.addActionListener(action_btnBack);
		
		JLabel lblBotlane = new JLabel("PlEnTra /Produkt hinzuf\u00FCgen");
		lblBotlane.setBounds(10, 420, 694, 14);
		frame.getContentPane().add(lblBotlane);
		
		frame.setVisible(true);
	}
	
	public ActionListener action_btnAddProduct = new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent arg0) {
			
		}
	};

	public ActionListener action_btnBack = new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent arg0) {

			frame.setVisible(false);
			
		}
	};
}
